import request, { downloadFile } from '@/utils/request'

const api = {
  create:'/equipmentMaintainance/create',
  update:'/equipmentMaintainance/update',
  delete:'/equipmentMaintainance/delete',
  findBypage:'/equipmentMaintainance/findByPage',
  downLoad:'/equipmentMaintainance/export',
  importExcel:'/equipmentMaintainance/import',
  findAllEquipment:'/equipmentMaintainance/findAllEquipment'
}

export default api

// export function findUserByPage (parameter) {
//   return request({
//     url: api.findUserByPage,
//     method: 'get',
//     params: parameter
//   })
// }

// 新建
export function createEquipment(parameter) {
  return request({
    url: api.create,
    method: 'post',
    data: parameter
  })
}
// 更新
export function updateEquipment(parameter) {
  return request({
    url: api.update,
    method: 'post',
    data: parameter
  })
}
// 删除
export function deleteEquipment(parameter) {
  return request({
    url: api.delete+ '?equipmentId=' + parameter,
    method: 'post',

  })
}
// 查询
export function findBypageEquipment(parameter) {
  return request({
    url: api.findBypage,
    method: 'get',
    params: parameter
  })
}
//下载
export function downLoadEquipment() {
  return downloadFile({
    url: api.downLoad,
    method: 'get',
  })
}
// 导入
export function importEquipment(data, params) {
  return request({
    url: api.importExcel,
    method: 'post',
    data: data,
    params: params
  })
}

export function findAllEquipments(parameter) {
  return downloadFile({
    url: api.downLoad,
    method:'get',
    params: parameter
  })
}


